package com.ang.create.prototype;

import java.util.Objects;

public class ConcretePrototype extends Prototype {

    private String filed;

    public ConcretePrototype(String filed) {
        this.filed = filed;
    }

    @Override
    Prototype myClone() {
        return new ConcretePrototype(filed);
    }

    @Override
    public String toString() {
        return filed;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ConcretePrototype)) return false;
        ConcretePrototype that = (ConcretePrototype) o;
        return Objects.equals(filed, that.filed);
    }

    @Override
    public int hashCode() {
        return Objects.hash(filed);
    }
}
